import request from '@/utils/request'

// 获取菜单信息
export function getRoleListApi(params) {
  return request({
    url: 'auth/menu',
    params
  })
}
// 根据id获取菜单信息
export function getRoleByIdApi(id) {
  return request({
    url: `auth/menu/${id}`
  })
}

// 获取菜单列表
export function getMenuListApi(params) {
  return request({
    url: 'auth/menu',
    params
  })
}
// 添加菜单
export function addRoleListApi(data) {
  return request({
    url: 'auth/role',
    method: 'post',
    data
  })
}
// 编辑菜单
export function updateRoleApi(data) {
  return request({
    url: `auth/role/${data.id}`,
    method: 'post',
    data
  })
}

// 删除菜单
export function delRoleListApi(id) {
  return request({
    url: `auth/role/${id}`,
    method: 'DELETE'

  })
}
